<template>
  <div>
    <tb-report
      :columns="columns"
      :apiUrl="apiUrl"
      :tableData="tableData"
      :getData="getData"
    ></tb-report>
  </div>
</template>

<script>
import TbReport from "@/components/tb-report/index.vue";

export default {
  name: "App",
  components: { TbReport },
  data() {
    return {
      title: "首页",
      apiUrl:"/scm/api/v1/scmLogisticsMonthlyPortGatherPlan/getPageList",
      columns:[
      { type: 'seq', key: 'seq', width: 50, title: '序号', align: 'center', fixed: 'left' },
    { key: 'batchStatusLabel', title: '状态', field: 'batchStatusLabel', width: 100 },
    {
      key: 'dispatch',
      title: '是否派单',
      field: 'dispatch',
      width: 100,
    },
    { key: 'dispatch', title: '是否派单', field: 'dispatch', width: 100 },
    {
      key: 'batchNo',
      title: '交货批次号',
      field: 'batchNo',
      align: 'center',
      width: 200,
    },
    { key: 'urgencyDegree', title: '紧急程度', field: 'urgencyDegree', width: 160 },
    { key: 'purchaseType', title: '采购类型', field: 'purchaseType', width: 100 },
    { key: 'logisticsSalesman', title: '物流业务员', field: 'logisticsSalesman', width: 100 },
    { key: 'loadVesselNumber', title: '配载船次', field: 'loadVesselNumber', width: 100 },
    { key: 'contractNo', title: '内贸合同号', field: 'contractNo', width: 140 },
    { key: 'programName', title: '项目名称', field: 'programName', width: 100 },
    { key: 'purchaserCorp', title: '出口商(甲方)', field: 'purchaserCorp', width: 140 },
    { key: 'supplier', title: '供应商(乙方)', field: 'supplier', width: 140 },
    { key: 'materialName', title: '物资名称', field: 'materialName', width: 100 },
    { key: 'purchaseSalesman', title: '采购业务员', field: 'purchaseSalesman', width: 100 },
    {
      key: 'priorityStowageDate',
      title: '优先配载日期',
      field: 'priorityStowageDate',
      width: 100,
    },
    {
      key: 'loadDeadline',
      title: '截止配载时间',
      field: 'loadDeadline',
      width: 100,
    },
    { key: 'quantity', title: '数量', field: 'quantity', width: 100 },
    { key: 'estimatedVolume', title: '预估体积/CBM', field: 'estimatedVolume', width: 120 },
    { key: 'estimatedGrossWeight', title: '预估毛量/Kgs', field: 'estimatedGrossWeight', width: 120 },
    {
      key: 'planDeliveryDate',
      title: '预计交货日期',
      field: 'planDeliveryDate',
      width: 100,
    },
    {
      key: 'planPortGatherDate',
      title: '计划集港日期',
      field: 'planPortGatherDate',
      width: 100,
    },
    {
      key: 'estimateFirstPackingListNo',
      title: '预估一级箱单',
      field: 'estimateFirstPackingListNo',
      width: 200,
    },
    {
      key: 'wrapCompleteDate',
      title: '包装完成日期',
      field: 'wrapCompleteDate',
      width: 100,
    },
    {
      key: 'noPort',
      title: '未集港原因',
      field: 'noPort',
      width: 200,
    },
    {
      key: 'portGatherNoticeDate',
      title: '集港通知日期',
      field: 'portGatherNoticeDate',
      width: 100,
    },
    {
      key: 'wharf',
      title: '集港码头',
      field: 'wharf',
      width: 100,
    },
    {
      key: 'portGatherCompleteDate',
      title: '集港完成日期',
      field: 'portGatherCompleteDate',
      width: 100,
    },
    {
      key: 'berthingTime',
      title: '靠泊时间',
      field: 'berthingTime',
      width: 100,
    },
    {
      key: 'departureTime',
      title: '离港时间',
      field: 'departureTime',
      width: 100,
    },
    {
      key: 'etaInIndonesia',
      title: '印尼ETA',
      field: 'etaInIndonesia',
      width: 100,
    },
    {
      key: 'requirePortGatherDate',
      title: '项目要求集港日期',
      field: 'requirePortGatherDate',
      width: 140,
    },
    {
      key: 'requirePortArriveDate',
      title: '要求海外到货日期',
      field: 'requirePortArriveDate',
      width: 140,
    },
    { key: 'remark', title: '备注', field: 'remark', width: 100 },
      ],
      tableData:[]
    };
  },
  methods:{
    getData(data){
           if (this.tableData.length == 0) {
            this.tableData = data;
           } else {
            this.tableData = [...this.tableData, ...data];
          }
    }
  }
};
</script>

<style>
</style>
